<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no" name="format-detection">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1;user-scalable=no;">
    <title>会员注册</title>
    <link rel="stylesheet" href="/statics/view/css/bootstrap.css">
    <link rel="stylesheet" href="/statics/view/css/style.css">
    <link rel="stylesheet" href="/statics/view/css/member.css">
    <link rel="stylesheet" href="/statics/view/css/order3.css">
    <script charset="utf-8" src="/statics/view/js/jquery.min.js"></script>
    <script type="text/javascript" src="/statics/view/js/common.js"></script>
    <script type="text/javascript" src="/statics/view/js/jquery.validate.js"></script>
    <script type="text/javascript" src="/statics/layer.m/layer.m.js"></script>
    <script type="text/javascript">
        $().ready(function() {
            var $regForm = $("#regForm");
            var $username = $("#username");
            var $password = $("#password");
            var $OkPassword = $("#OkPassword");
            var $smsCode = $("#smsCode");

            // 表单验证
            $regForm.validate({
                rules: {
                    username: "required",
                    password: "required",
                    smsCode: "required",
                    OkPassword: {
                        required: true,
                        equalTo: "#password"
                    }

                },
                submitHandler: function(form) {
                    layer.open({
                        type: 2,
                        content: '注册中~'
                    });
                    if($("#user-reg").hasClass("disabled")){
                        return false;
                    }
                    $("#user-reg").addClass("disabled");
                    $.ajax({
                        url: $regForm.attr("action"),
                        type: "POST",
                        data: {
                            username: $username.val(),
                            password: $password.val(),
                            smsCode : $smsCode.val()
                        },
                        dataType: "json",
                        cache: false,
                        success: function(message) {
                            layer.closeAll();
                            $("#user-reg").removeClass("disabled");
                            if (message.type == "success") {
                            [#if redirectUrl??]
                                location.href = "${redirectUrl}";
                            [#else]
                                location.href = "/";
                            [/#if]
                            } else {
                                layer.open({
                                    content: message.content,
                                    time: 2
                                });
                            }
                        },error:function(){
                            $("#user-login").removeClass("disabled");
                            layer.closeAll();
                            layer.open({
                                content: "服务器异常",
                                time: 2
                            });
                        }
                    });
                }
            });
        });
    </script>
</head>
<body style="background-color:#fff">


<div class="maincontainer">
    <div class="container itemdetail mini-innner">
        <div class="row">
            <header class="header" style="height:44px;">
                <div class="fix_nav">
                    <div style="max-width:768px;margin:0 auto;background:#db3652;position: relative;">
                        <a class="nav-left back-icon" href="/login">返回</a>
                        <div class="tit">会员注册</div>
                        <a class="nav-right icon-home" href="/dbs/index.html">首页</a>
                    </div>
                </div>
            </header>
        </div>
        <div class="row mt20"></div>
        <div class="row">
            <div class="col-md-12" data-validform="regForm">
                <form id="regForm" action="/reg_validate"  class="form-horizontal"  method="post">

                    <div class="form-group">
                        <label for="phone" class="col-xs-offset-1 col-xs-2 control-label p0">帐号：</label>
                        <div class="col-sm-7 col-xs-9">
                            <input type="text" name="username" id="username" maxlength="11" class="form-control" placeholder="请输入您的手机号码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="phone" class="col-xs-offset-1 col-xs-2 control-label p0">密码：</label>
                        <div class="col-sm-7 col-xs-9">
                            <input type="password" name="password" id="password" class="form-control" placeholder="请输入您的登录密码" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="phone" class="col-xs-offset-1 col-xs-2 control-label p0">确认密码：</label>
                        <div class="col-sm-7 col-xs-9">
                            <input type="password" name="OkPassword" id="OkPassword" class="form-control" placeholder="请再次输入登录密码" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="code" class="col-xs-offset-1 col-xs-2 control-label p0">验证码：</label>
                        <div class="col-sm-4 col-xs-4 pr0">
                            <input type="text" name="captcha" class="form-control" id="smsCode" placeholder="6位手机验证码">
                        </div>
                        <div class="col-sm-3 col-xs-5">
                            <input type="button" class="form-control btn btn-danger get_mobile_code"  id="getCode" data-type="register" value="获取手机验证码" style="padding:0px;">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-offset-3 col-xs-6 mt10">
                            <input  type="checkbox"  id="Ok_server"  tabindex="4" /> 服务条款<a href="javascript:;">《1块抢注册协议》</a>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-offset-3 col-xs-6 mt10">
                            <button type="submit"  class="btn btn-success vip_reg btn-lg" data-action="loginCheck" id="user-reg" disabled="disabled">立刻注册</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

</div>
<script type="text/javascript">

</script>

</body>
</html>